import React, { useState } from 'react';


const Parent = (props) => {
    const [title, setTitle] = useState('son组件');
    return (
        <>
            <h2>这是子组件</h2>
            {props.children(title)}
        </>
    )
};

export default Parent;